<?php

namespace app\common\validate;

use think\Validate;

class Admin extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名'	=>	['规则1','规则2'...]
     *
     * @var array
     */
	protected $rule = [
	    'username' => 'require|length:5,10',
        'password' => 'require|min:length:6,16',
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名'	=>	'错误信息'
     *
     * @var array
     */
    protected $message = [
        'username.require' => "用户名必须",
        'username.length'  => "用户名必须5到10位",
        'password'         => "密码必须",
        'password.length'  => "密码必须6到16位",
    ];

    protected $scene = [
        'login'  => ['username'=>"require",'password'=>"require"],
    ];
}
